function [ hardDetectedSymbols, softDetectedSymbols ] = ...
                                 kalmanEqualizerMatlab( rxSymbols, trainingSymbols, ...
                                      constellation, Nf, Nb, p )
midTapIndex=round(Nf/2);
N=Nf+ Nb;

numDataSymbols=256;
numTrainingSymbols=31;

forgetttingFactor=0.97;

numSymbolsToEqualize=numDataSymbols+numTrainingSymbols+Nf/p;

% Equalize the received signal.
algorithm=rls(forgetttingFactor, 1);

equalizerObject=dfe(Nf, Nb, algorithm, constellation, p);
%equalizerObject.RefTap=midTapIndex;
equalizerObject.ResetBeforeFiltering=1;
equalizerObject.Weights=[zeros(1,Nf/2) , 1 , zeros(1,Nf/2 - 1), zeros(1,Nb)];
%equalizerObject.Weights=zeros(1,Nf);
%equalizerObject.NumSamplesProcessed=numSymbolsToEqualize;

% nSampPerSym: Number of samples per symbol
% RefTap: Reference tap index (from 1 to NFWDWEIGHTS)
% SigConst: Signal constellation
% Weights: Complex coefficient vector
% WeightInputs: Tap weight input vector
% ResetBeforeFiltering: Resets equalizer state every call (0 or 1)
% NumSamplesProcessed: Number of samples processed

[softDetectedSymbols, hardDetectedSymbols ] =equalize(equalizerObject, rxSymbols, trainingSymbols);       

end

